const express = require('express');
const asyncHandler = require('express-async-handler');
const basicControl = require('../controllers/basic.controller');
const router = express.Router();
module.exports = router;

router.post('/getPersonInfoDetailById', asyncHandler(getPersonInfoDetailById))
router.post('/getDailyStatistic', asyncHandler(getDailyStatistic))
router.post('/getDailyAttendence', asyncHandler(getDailyAttendence))
router.post('/getPersonInfoList', asyncHandler(getPersonInfoList))

async function getPersonInfoDetailById(req, res) {
    let result = await basicControl.getPersonInfoDetailById(req.body)
    res.json(result)
}

async function getDailyStatistic(req, res) {
    let result = await basicControl.getDailyStatistic(req.body)
    res.json(result)
}

async function getDailyAttendence(req, res) {
    let result = await basicControl.getDailyAttendence(req.body)
    res.json(result)
}

async function getPersonInfoList(req, res) {
    let result = await basicControl.getPersonInfoList(req.body)
    res.json(result)
}


